package com.joolun.web.api;

import com.joolun.common.core.controller.BaseWxController;
import com.joolun.common.core.page.TableDataInfo;
import com.joolun.mall.domain.Swiper;
import com.joolun.mall.service.ISwiperService;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/weixin/api/ma/swiper")
@Api(value = "swiper", tags = "小程序轮播图")
public class SwiperApi extends BaseWxController {


    @Autowired
    private ISwiperService swiperService;

    @GetMapping("/list")
    public TableDataInfo list(Swiper swiper)
    {
        startPage();
        List<Swiper> list = swiperService.selectSwiperList(swiper);
        return getDataTable(list);
    }
}
